import {iput} from "@/api/index";
import {ElMessage} from "element-plus";

export const changePassword = async function (formData) {
    try {

        const res = await iput('/user/changePassword', formData);
        if (res.data.code === 200) {
            ElMessage.success('密码修改成功');
        } else {
            ElMessage.error('密码修改失败');
        }
    } catch (error) {
        ElMessage.error('密码修改失败');
        console.error('密码修改失败,' + error);
    }
}
